import {useUserStore} from "@/stores/index.js";

/**
 * hasRole() 登录用户是否可以看到被标记的标签
 * @param el
 * @param binding binding.value ：访问该标签需要的角色
 * @param vnode
 * @param prevVNode
 */
export default function hasRole(el, binding, vnode, prevVNode) {
    const userStore = useUserStore()
    const roles = userStore.userInfo.role
    if (roles !== binding.value) {
        el.remove()
    }
}